# class Solution:
#     def duplicate(self, numbers):
#         """找出列表中的重复数字"""
#         if numbers is None or len(numbers) <= 1:
#             return False
#         use_set = set()
#         duplication = {}
#         for index, value in enumerate(numbers):
#             if value not in use_set:
#                 use_set.add(value)
#             else:
#                 duplication[index] = value
#         return duplication
#
# if __name__ == '__main__':
#     s = Solution()
#     d = s.duplicate([1, 2, -3, 4, 4, 95, 95, 5, 2, 2, -3, 7, 7, 5])
#     print(d)

def find_single(l :list):
    """找出列表中的单个数字"""
    result = 0
    for v in l:
        # ^ 运算符是二进制XOR（异或），因此 ^ = 是V在result上的异或，放回result中。
        result ^= v
        if result == 0:
            print("没有落单元素")
        else:
            print("落单元素", result)

if __name__ == '__main__':
    l = [1, 2, 3, 4, 5, 6, 2, 3, 4, 5, 6]
    find_single(l)


# def bubble_sort(arry):
#     n = len(arry)
#     f = n -1
#     for _ in range(n-1):
#         for i in range(f):
#             if arry[i+1] < arry[i]:
#                 arry[i], arry[i+1] = arry[i+1], arry[i]
#         f -= 1
#     return arry
# if __name__ == '__main__':
#     l = [1, 2, 3, 4, 5, 6, 2, 3, 4, 5, 6]
#     print(bubble_sort(l))